const express = require('express')
const router = express.Router()
const {residentModel} = require('../model/model')

router.post('/add_resident', async (req, res) => {
    let { name, phoneNumber, building, unit_id, gender, apartmentNumber, idNumber, residentType, remark, community_id } = req.body
    await residentModel.create({
      name, phoneNumber, unit_id, apartmentNumber, gender, idNumber, residentType, remark, community_id
    })
    res.send({
      code: 200,
      msg: '添加成功'
    })
  })



router.get('/get_resident',(req,res)=>{
  res.send({
    code: 200,
    msg: '添加成功'
  })
})
router.get('/get_community',(req,res)=>{
  res.send({
    code: 200,
    msg: '添加成功'
  })
})

module.exports = router